package com.sob.lupus.entidades;

import java.awt.Rectangle;
import org.newdawn.slick.Color;
import org.newdawn.slick.Image;
import org.newdawn.slick.SlickException;

public class Entidad {
	
	Image sprite;
	public int x=0;
	public int y=0;
	private int width = 0;
	private int height = 0;
	
	public Entidad() {
		super();
	}
	
	public Entidad(String filename) throws SlickException {
		sprite=new Image(filename, new Color(0xF600FF));
	}

	public Rectangle getBounds()
	{
		int w=sprite.getWidth();
		int h=sprite.getHeight();
		Rectangle r=new Rectangle(x, y, w, h);
		
		return r;
	}

	public int getWidth(){
		return sprite.getWidth();
	}

	public int getHeight(){
		return sprite.getHeight();
	}

	public int getCX()
	{
		return x+sprite.getWidth()/2;
	}
	public int getCY()
	{
		return y+sprite.getHeight()/2;
	}
	
	public void draw(int ox, int oy){
		sprite.draw(x-ox,y-oy);
	}
}
